package main

import (
	"context"
	"gin-rkboot-sw/internal/model"
	"gin-rkboot-sw/internal/router"
	rkboot "github.com/rookie-ninja/rk-boot/v2"
	rkgin "github.com/rookie-ninja/rk-gin/v2/boot"
	"log"
)

// @title Swagger Example API
// @version 1.0
// @description This is a sample rk-demo server.
// @termsOfService http://swagger.io/terms/

// @securityDefinitions.basic BasicAuth

// @contact.name API Support
// @contact.url http://www.swagger.io/support
// @contact.email support@swagger.io

// @license.name Apache 2.0
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html
func main() {
	boot := rkboot.NewBoot()
	if err := model.InitDB(); err != nil {
		log.Panicf("error: %v", err)
	}
	
	// Register API
	entry := rkgin.GetGinEntry("greeter")
	router.BindAllRouter(entry.Router)

	boot.Bootstrap(context.TODO())

	boot.WaitForShutdownSig(context.TODO())
}
